<template>
  <div class="container">
    <!-- 内容部分 -->
    <div class="operate">
      <slot></slot>
      <div style="margin-right: auto"></div>
      <slot name="op"></slot>
    </div>
    <div
      class="content"
      :style="{ maxHeight: item.h * 40 - 70 + 'px' }"
      :key="item.h + item.w"
    >
      <div
        v-if="!!list?.length"
        class="content-item"
        v-for="element in list"
        :key="element.id"
      >
        <div class="content-item-main">
          <div :style="{ color: 'black' }">{{ element.text }}</div>
          <div>{{ element.creator }}</div>
        </div>
        <div>{{ element.createTime }}</div>
      </div>
      <NoData v-else />
    </div>
  </div>
</template>

<script setup lang="ts">
  /**
   * @description 业务组件 -- 公告
   */
  import { ref, defineProps } from "vue";
  const props = defineProps(["item"]);
  const list = ref(props.item?.data?.projectAnnouncementVoList);
  import NoData from "./commonCom/NoData.vue";
</script>

<style scoped lang="scss">
  .container {
    user-select: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    font-size: 14px;
    color: #999;
    padding: 0px 10px 10px;
  }

  .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    overflow: auto;
  }

  .content-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
  }
  .content-item-main {
    display: flex;
    flex-direction: column;
  }
  .operate {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }
</style>
